package com.zh.operation.service.impl;

import com.zh.common.utils.StringUtil;
import com.zh.operation.dao.BedDao;
import com.zh.operation.domain.BedDO;
import com.zh.operation.service.BedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;


@Service
public class BedServiceImpl implements BedService {
	@Autowired
	private BedDao bedDao;
	
	@Override
	public BedDO get(String id){
		return bedDao.get(id);
	}
	
	@Override
	public List<BedDO> list(Map<String, Object> map){
		return bedDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return bedDao.count(map);
	}
	
	@Override
	public int save(BedDO bed){
		bed.setBedId(StringUtil.generalKeyword());//id
		bed.setCreateDate(new Date());//创建时间
		return bedDao.save(bed);
	}
	
	@Override
	public int update(BedDO bed){
		return bedDao.update(bed);
	}
	
	@Override
	public int remove(String bed_id){
		return bedDao.remove(bed_id);
	}
	
	@Override
	public int batchRemove(String[] ids){
		return bedDao.batchRemove(ids);
	}

	@Override
	public List<BedDO> getAll() {
		return bedDao.getAll();
	}

}
